package routers

import (
	"docker_xzdream/api"

	"github.com/gin-gonic/gin"
)

func InitRouter(r *gin.Engine) {

	//后端接口分组
	gateway := r.Group("/docker/")
	{
		//容器
		gateway.GET("ContainerList", api.ContainerList)
		gateway.GET("ContainerRemove", api.ContainerRemove)
		gateway.GET("ContainerStart", api.ContainerStart)
		gateway.GET("ContainerStop", api.ContainerStop)
		gateway.GET("ContainerRestart", api.ContainerRestart)
		//镜像
		gateway.GET("ListImages", api.ImagesList)
		gateway.GET("ImageRemove", api.ImageRemove)
		gateway.GET("ImagePull", api.ImagePull)
		gateway.GET("ContainerCreate", api.ContainerCreate)
	}
	//文件接口分组
	fileGroup := r.Group("/file")
	{
		//下载文件http://127.0.0.1:8081/file/DownloadFile?name=go.mod
		fileGroup.GET("DownloadFile", api.DownloadFile)
		fileGroup.GET("FileList", api.FileList)
	}

	//社交人情组
	socialContactGroup := r.Group("/socialContact")
	{
		socialContactGroup.POST("createSocialContactType", api.CreateSocialContactType)
	}
}
